package org.henzhi.dao.imple;

import java.sql.SQLException;

import org.henzhi.dao.IUserDao;
import org.henzhi.entity.user;
import org.henzhi.util.BaseDao;

public class UserDaoImple extends BaseDao implements IUserDao {
 user user=null;
	public user login(String uname){
	    String sql="select * from user_tab where uname=?"; 
	   try {
		rs= exeQuery(sql, new Object[]{uname});
		if(rs.next()){
			user =new user(rs.getInt("uid"),
					rs.getString("uname"), 
					rs.getString("upwd"),
					rs.getString("email"),
					rs.getInt("age"),
					rs.getInt("sex"),
			        rs.getString("address"),
			        rs.getString("tel"),
			        rs.getInt("rid")
					);
		}
		closeAll();
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	  
		return user;
	}

}
